#!/bin/bash

root_path="/opt/ruoyi/"
backend_path=${root_path}/ruoyi-fastapi-backend/
echo "开始启动ruoyi应用..."

# 启动 mysqld 服务
systemctl start mysqld
sleep 1
echo "mysqld 服务已启动."

# 启动 ruoyi 应用后台服务
nohup /opt/miniconda3/envs/ruoyi/bin/python -u ${backend_path}app.py --env=prod >>${root_path}/ruoyi.log 2>&1 &

# 启动 nginx 服务
systemctl start nginx
sleep 1
echo "nginx 服务已启动."

# 启动 redis 服务
systemctl start redis
sleep 1
echo "redis 服务已启动."
